#!/usr/bin/bash

trap "func" 2

func() {
	read -p "Terminate theprocess? (Y/N): " input
        if [ $input == "Y" ] ;
        then
    	    exit
	fi 
} 

for i in {1..10}
do
   echo $i
   sleep 1
done 
